package finneyfill;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class SslAndJava {

	// http://www.heatonresearch.com/articles/146/page2.html
	public static void main(String[] args) throws Exception {
		// https://www.stephencovey.com/

		try {
			URL u = new URL("https://www.stephencovey.com");
			HttpURLConnection http = (HttpURLConnection) u.openConnection();
			// Now do something with the connection.

			InputStream inputStream = http.getInputStream();
			InputStreamReader inputStreamReader = new InputStreamReader(
					inputStream);
			BufferedReader bufferedReader = new BufferedReader(
					inputStreamReader);

			String readLine = null;
			while ((readLine = bufferedReader.readLine()) != null) {
				System.out.println(readLine);
			}

		} catch (MalformedURLException e) {
			System.out.println("Invalid URL");
		} catch (IOException e) {
			System.out.println("Error connecting: " + e.getMessage());
		}
	}
}
